package com.chinasofti.zbest.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinasofti.zbest.dao.AdminMapper;
import com.chinasofti.zbest.dao.OrderTMapper;
import com.chinasofti.zbest.dao.model.Admin;
import com.chinasofti.zbest.dao.model.OrderTM;
import com.chinasofti.zbest.service.IOrderTMService;
import com.chinasofti.zbest.web.form.OrderTMForm;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class OrderTMServiceImpl implements IOrderTMService {

    @Autowired
    private OrderTMapper orderTMapper;

    @Override
    public void createOrderTM(OrderTMForm orderTMForm) {

        OrderTM orderTM = new OrderTM();

        BeanUtils.copyProperties(orderTMForm,orderTM);

        orderTMapper.createOrderTM(orderTM);
    }

    @Override
    public OrderTM queryByOrderNum(Integer userId , String orderNum) {
        OrderTM orderTM = orderTMapper.queryByOrderNum(userId , orderNum);
        return orderTM;
    }
}
